package com.dudetest.data.objectify.subclassed;

import javax.persistence.Id;

import com.dudetest.data.DAOFactory;
import com.dudetest.dude.Dude;
import com.dudetest.dude.DudeImpl;
import com.googlecode.objectify.Key;
import com.googlecode.objectify.annotation.Cached;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Unindexed;

@Entity
@Cached
@Unindexed
public abstract class DudeSubclassed extends DudeImpl implements Dude{
	@Id private long id;
	
	public DudeSubclassed(){}
	
	public DudeSubclassed(long id){
		super(id);
	}
	
	@Override
	public long getId() {
		return this.id;
	}
	@Override
	public void setId(long id) {
		this.id = id;
	}
	
	public abstract Key<? extends Dude> getKey();
	
	public String getReference(){
		return DAOFactory.fact().keyToString(this.getKey());
	}
	
}
